import Vue from 'vue'
import Router from 'vue-router'
import App from '@/App.vue'
import Home from '@/views/Home/home.vue'
const overview = () => import('@/views/Home/overview.vue')
const maintain = () => import('@/views/Home/maintain.vue')
const warning = () => import('@/views/Home/warning.vue')
const house = () => import('@/views/Home/house.vue')
const loss = () => import('@/views/Home/loss.vue')
const monitor = () => import('@/views/Home/monitor.vue')
const videoMonitor = () => import('@/views/Home/videoMonitor.vue')
const statistics = () => import('@/views/ReportStatistics/statistics.vue')
const pressure = () => import('@/views/ReportStatistics/pressure.vue')
const consume = () => import('@/views/ReportStatistics/consume.vue')
const water = () => import('@/views/ReportStatistics/water.vue')
const police = () => import('@/views/ReportStatistics/police.vue')
// const homeInfo = () => import('@/views/HomeInfo/homeInfo.vue')
const houseInfo = () => import('@/views/HomeInfo/houseInfo.vue')
const maintainInfo = () => import('@/views/HomeInfo/maintainInfo.vue')
const working = () => import('@/views/HomeInfo/working.vue')
// import Auto from './auto'
Vue.use(Router)

export default new Router({
  routes: [
    {
      path: '/',
      redirect: '/home',
      component: App,
      children: [
        {
          path: '/home', // 主页面 泵房总览
          components: { default: Home },
          meta: { title: '首页', fullPath: 'home.vue' },
        },
        {
          path: '/overview',
          components: { default: overview },
          meta: { title: '总览信息', fullPath: 'overview.vue' },
        },
        {
          path: '/maintain',
          components: { default: maintain },
          meta: { title: '维保/安防统计', fullPath: 'maintain.vue' },
        },
        {
          path: '/warning',
          components: { default: warning },
          meta: { title: '报警监控', fullPath: 'warning.vue' },
        },
        {
          path: '/house',
          components: { default: house },
          meta: { title: '泵房信息', fullPath: 'house.vue' },
        },
        {
          path: '/loss',
          components: { default: loss },
          meta: { title: '吨水电耗', fullPath: 'loss.vue' },
        },
        {
          path: '/monitor',
          components: { default: monitor },
          meta: { title: '近七天水质检测', fullPath: 'monitor.vue' },
        },
        {
          path: '/videoMonitor',
          components: { default: videoMonitor },
          meta: { title: '视频监控', fullPath: 'videoMonitor.vue' },
        },
        {
          path: '/houseInfo',
          components: { default: houseInfo },
          meta: { title: '维保/安防统计2', fullPath: 'houseInfo.vue' },
        },
        {
          path: '/maintainInfo',
          components: { default: maintainInfo },
          meta: { title: '报警监控', fullPath: 'maintainInfo.vue' },
        },
        {
          path: '/working',
          components: { default: working },
          meta: { title: '泵组运行参数', fullPath: 'working.vue' },
        },
      ],
    },
    {
      path: '/statistics', // 弹窗报表统计路由
      components: { default: statistics },
      meta: { title: '报表统计', fullPath: 'statistics.vue' },
      children: [
        {
          path: '/pressure',
          components: { default: pressure },
          meta: { title: '压力曲线', fullPath: 'pressure.vue' },
        },
        {
          path: '/consume',
          components: { default: consume },
          meta: { title: '能耗分析', fullPath: 'consume.vue' },
        },
        {
          path: '/water',
          components: { default: water },
          meta: { title: '水质分析', fullPath: 'water.vue' },
        },
        {
          path: '/police',
          components: { default: police },
          meta: { title: '历史报警', fullPath: 'police.vue' },
        }
      ]
    },
  ],
})
